package com.ikun.yummy.manager;

import android.content.Context;

import com.ikun.yummy.bean.CommentInfo;
import com.ikun.yummy.sourceop.op.CommentOP;

import java.util.List;

public class CommentOpManager {
    private final CommentOP commentOP;
    public CommentOpManager(Context context){
        commentOP = new CommentOP(context);
    }
    public void addComment(CommentInfo commentInfo){
        commentOP.addComment(commentInfo);
   }
    public List<CommentInfo>queryByCookid(String cookid){
        return commentOP.queryByCookid(cookid);
    }
    public void deleteCommentByCommentId(String commentid){
        commentOP.deleteCommentByCommentId(commentid);
    }
    public CommentInfo queryCommentByCommentId(String commentid){//长按回复时用来删除回复所要用到的回复info，CommentInfo不是评论是回复
        return commentOP.queryCommentByCommentId(commentid);
    }
    public void updateById(CommentInfo commentInfo){
        commentOP.updateByCommentId(commentInfo);
    }
    //删除我的作品的时候用它删除评论
    public void deleteCommentCookid(String cookid){
        commentOP.deleteCommentCookid(cookid);
    }
}
